package chances.wechat.ctrl;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import chances.epg.commons.log.EpgLogFactory;
import chances.wechat.service.ProxyService;

@Controller
@RequestMapping(path = "/wechat")
public class ProxyController {

    final static Logger sysLogger = EpgLogFactory.getSystemLogger();

    @Autowired
    private ProxyService proxyService;

    @RequestMapping("/proxy")
    public void bind(HttpServletRequest request, HttpServletResponse response) throws IOException {
        proxyService.proxy(request, response, "/proxy");
    }
}
